package com.hl.web.fore;

import com.hl.pojo.Ceping;
import com.hl.service.CepingService;
import com.hl.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ceping")
public class CepingController {
    @Autowired
    private CepingService cepingService;

    @RequestMapping("/add")
    public ResultEntity add(@RequestBody Ceping ceping){
        cepingService.add(ceping);
        return ResultEntity.ok();
    }

    @RequestMapping("/del")
    public ResultEntity del(@RequestBody Ceping ceping){
        cepingService.del(ceping);
        return ResultEntity.ok();
    }

    @RequestMapping("/findAll")
    public ResultEntity findAll(){
        return ResultEntity.ok(cepingService.findAll());
    }
}
